package net.oschina.git.zengzhihao.two;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * 先来先服务算法
 * 
 * @author zengzhihao
 */
public class FCFS {

	public static List<JCB> fcfs(List<JCB> jcbs) {
		// 按到达时间排序
		Collections.sort(jcbs, new Comparator<JCB>() {
			@Override
			public int compare(JCB o1, JCB o2) {
				return o1.getArrivalTime().compareTo(o2.getArrivalTime());
			}
		});

		return jcbs;
	}

}
